<?php

/**
 * Ftpquotalimits form base class.
 *
 * @package    form
 * @subpackage ftpquotalimits
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseFtpquotalimitsForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'               => new sfWidgetFormInputHidden(),
      'quota_type'       => new sfWidgetFormChoice(array('choices' => array('user' => 'user', 'group' => 'group', 'class' => 'class', 'all' => 'all'))),
      'per_session'      => new sfWidgetFormChoice(array('choices' => array('false' => 'false', 'true' => 'true'))),
      'limit_type'       => new sfWidgetFormChoice(array('choices' => array('soft' => 'soft', 'hard' => 'hard'))),
      'bytes_in_avail'   => new sfWidgetFormInput(),
      'bytes_out_avail'  => new sfWidgetFormInput(),
      'bytes_xfer_avail' => new sfWidgetFormInput(),
      'files_in_avail'   => new sfWidgetFormInput(),
      'files_out_avail'  => new sfWidgetFormInput(),
      'files_xfer_avail' => new sfWidgetFormInput(),
      'name'             => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'               => new sfValidatorDoctrineChoice(array('model' => 'Ftpquotalimits', 'column' => 'id', 'required' => false)),
      'quota_type'       => new sfValidatorChoice(array('choices' => array('user' => 'user', 'group' => 'group', 'class' => 'class', 'all' => 'all'))),
      'per_session'      => new sfValidatorChoice(array('choices' => array('false' => 'false', 'true' => 'true'))),
      'limit_type'       => new sfValidatorChoice(array('choices' => array('soft' => 'soft', 'hard' => 'hard'))),
      'bytes_in_avail'   => new sfValidatorInteger(),
      'bytes_out_avail'  => new sfValidatorInteger(),
      'bytes_xfer_avail' => new sfValidatorInteger(),
      'files_in_avail'   => new sfValidatorInteger(),
      'files_out_avail'  => new sfValidatorInteger(),
      'files_xfer_avail' => new sfValidatorInteger(),
      'name'             => new sfValidatorString(array('max_length' => 30, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('ftpquotalimits[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Ftpquotalimits';
  }

}
